import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'

const routes: Array<RouteRecordRaw> = [
  {
  //路由初始指向
    path: '/',
    name: 'Layout',
    component:Layout,
  },
  {
    path: '/login',
    name: 'Login',
    component:()=>import('@/views/Login/index.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFount',
    component:()=>import('@/views/404/index.vue'),
  },
  {
    path: '/shop',
    name: 'Shop',
	component:Layout, 
	children:[
		{path:'/shop',
		name:'Shop',
		component:()=>import('@/views/Shop/index.vue')}, 
	]
  },{
    path: '/dishes',
    name: 'Dishes',
  	component:Layout, 
  	children:[
  		{path:'/dishes',
  		name:'Dishes',
  		component:()=>import('@/views/Dishes/index.vue')}, 
  	]
  },{
    path: '/order',
    name: 'Order',
  	component:Layout, 
  	children:[
  		{path:'/order',
  		name:'Order',
  		component:()=>import('@/views/Order/index.vue')}, 
  	]
  },{
    path: '/member',
    name: 'Member',
  	component:Layout, 
  	children:[
  		{path:'/member',
  		name:'Member',
  		component:()=>import('@/views/Member/index.vue')}, 
  	]
  }
]

const router = createRouter({
	//import.env.VITE_BASE_URL, // 设置路由的基本路径，根据你的项目配置进行调整
  history: createWebHistory(),
  routes
})

export default router

